SOLR-18297 Upgrade Jetty to 12.1.10#4574
Conversation
- BlockingArrayQueue(int,int) ctor removed: use newInstance(256, Integer.MAX_VALUE) - org.eclipse.jetty.io.RuntimeIOException -> java.io.UncheckedIOException - HttpClient.getTransport() -> getHttpClientTransport() - Regenerate lockfiles + license sha1s (new jetty-compression-* modules, jetty-ee->jetty-ee-webapp rename)
Jetty 12.1 removed the DeploymentManager/ContextProvider directory-scanning deployer. Since Solr serves a single, statically-known webapp, deploy it directly into the ContextHandlerCollection in jetty.xml and drop the now-redundant contexts/solr-jetty-context.xml. Verified: server starts, /solr returns 200, gzip works. Also: set maxResponseHeaderSize explicitly (configurable; Jetty 12.1 changed its default 8192->16384) and remove the redundant relativeRedirectAllowed=true (now the Jetty 12.1 default).
…deployer migration (SOLR-18297)
…nce apache#4572 merges) Squashed changes from apache#4572 'Fix UI build due to Ktor upgrade' (dsmiley) to unblock CI/testing of this branch. Without it the solr:ui wasmJs browser webpack build fails on node:net, forcing -PdisableUiModule=true locally. THIS COMMIT IS TEMPORARY and must be dropped/reverted once apache#4572 is merged to main and this branch is rebased onto it.
|
The test failures are real for |
…ernode proxy
Jetty 12.1 aborts responses whose written bytes don't match a declared
Content-Length ('too much content written' / 400). Solr's streaming
writers can't predict the length, so:
- JettyBridgeResponseWriter: don't set Content-Length; send chunked.
- HttpSolrProxy: don't forward Host or Content-Length; the Jetty client
re-derives them for the upstream.
|
Fixed two Jetty 12.1 test failures caused by its stricter Content-Length enforcement (writing bytes != declared length now aborts with "too much content written"/400):
Both reproduced with the CI seed and now pass; full test classes green; |
dsmiley
left a comment
There was a problem hiding this comment.
You said somethjing about a distributed trace fix but... I don't see changes htere.
|
# Conflicts: # solr/modules/s3-repository/gradle.lockfile
…ers. Proxy RESPONSE will only forward "Content-Length" header when upstream sets one.
|
@dsmiley Both code paths now conditionally forward Content-Lenght when >0 and known. Added some new tests as well. |
…inistic proxy CL test - JettyBridgeResponseWriter: use setContentLengthLong (drops the int cast and MAX_VALUE guard); simplify the >0 guard comment. - HttpSolrProxyTest: make the response Content-Length assertion unconditional (rows=0 stays within Jetty's buffer so the origin always frames it with a length); note why a filestore fetch isn't applicable (it doesn't proxy).
|
Thanks for good teamwork David. I'll burn some Copilot tokens and then merge to main as a first step, let it marinate on main for some time and backport to 10x in time for a 10.1 release. |
There was a problem hiding this comment.
Pull request overview
Upgrades Solr’s embedded Jetty stack to Eclipse Jetty 12.1.10, including necessary API migrations and a Jetty server configuration update to account for Jetty 12.1 removing the directory-scanning deployer, plus related test and documentation updates.
Changes:
- Bump Jetty from 12.0.34 → 12.1.10 (version catalog, lockfiles, and license SHA1s).
- Migrate
server/etc/jetty.xmlto deploy Solr’s single webapp directly (removeserver/contexts/solr-jetty-context.xml). - Adapt code/tests for Jetty 12.1 API/behavior changes (HTTP client transport API changes; proxy request/response framing;
RuntimeIOExceptionremoval).
Reviewed changes
Copilot reviewed 93 out of 93 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| solr/webapp/gradle.lockfile | Lock Jetty artifacts to 12.1.10; add new compression modules. |
| solr/ui/gradle.lockfile | Update Kotlin/WASM dependency lock resolution (Ktor client JS vs CIO for WASM). |
| solr/ui/build.gradle.kts | Scope Ktor CIO to desktop; add Ktor JS client for WASM. |
| solr/test-framework/gradle.lockfile | Lock Jetty test dependencies to 12.1.10; add compression modules. |
| solr/solrj/gradle.lockfile | Lock Jetty test dependencies to 12.1.10; add compression modules. |
| solr/solrj-zookeeper/gradle.lockfile | Lock Jetty test dependencies to 12.1.10; add compression modules. |
| solr/solrj-streaming/gradle.lockfile | Lock Jetty test dependencies to 12.1.10; add compression modules. |
| solr/solrj-jetty/src/test/org/apache/solr/client/solrj/jetty/HttpJettySolrClientCompatibilityTest.java | Update Jetty HttpClient transport accessor API usage. |
| solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java | Replace deprecated/removed BlockingArrayQueue constructor usage. |
| solr/solrj-jetty/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc | Add upgrade note about Jetty deployer removal and config change. |
| solr/solr-ref-guide/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/server/gradle.lockfile | Lock server Jetty dependencies to 12.1.10; add compression modules and renamed EE webapp artifact. |
| solr/server/etc/jetty.xml | Deploy Solr webapp directly; add max response header size property; remove deployer block. |
| solr/server/contexts/solr-jetty-context.xml | Remove obsolete context descriptor (no longer used without deployer). |
| solr/packaging/test/test_start_solr.bats | Add packaging test to verify /solr context deployment. |
| solr/modules/sql/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/scripting/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/s3-repository/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules and renamed EE webapp artifact. |
| solr/modules/opentelemetry/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/ltr/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/language-models/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/langid/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/jwt-auth/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/gcs-repository/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/extraction/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/cuvs/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/cross-dc/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/clustering/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/modules/analysis-extras/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/cross-dc-manager/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules and renamed EE webapp artifact. |
| solr/core/src/test/org/apache/solr/servlet/HttpSolrProxyTest.java | Add regression tests for Jetty 12.1 proxy request/response framing behavior. |
| solr/core/src/java/org/apache/solr/servlet/HttpSolrProxy.java | Adjust proxy header/body handling for Jetty 12.1 (Host/Content-Length). |
| solr/core/src/java/org/apache/solr/jersey/container/JettyBridgeResponseWriter.java | Adjust Content-Length propagation behavior for Jetty/Jersey bridge. |
| solr/core/src/java/org/apache/solr/handler/CatStream.java | Replace removed Jetty RuntimeIOException with JDK UncheckedIOException. |
| solr/core/src/java/org/apache/solr/core/SolrCore.java | Replace removed Jetty RuntimeIOException with JDK UncheckedIOException. |
| solr/core/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/benchmark/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| solr/api/gradle.lockfile | Lock Jetty dependencies to 12.1.10; add compression modules. |
| gradle/libs.versions.toml | Bump Jetty version to 12.1.10; add Ktor JS client alias. |
| changelog/unreleased/SOLR-18297-update-jetty-12.1.10.yml | Add changelog entry for the Jetty upgrade. |
| solr/licenses/jetty-xml-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-xml-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-util-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-util-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-start-12.1.10-shaded.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-start-12.0.34-shaded.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-session-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-session-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-server-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-server-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-security-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-security-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-rewrite-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-rewrite-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-jmx-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-jmx-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-io-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-io-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-http2-server-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-http2-server-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-http2-hpack-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-http2-hpack-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-http2-common-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-http2-common-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-http2-client-transport-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-http2-client-transport-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-http2-client-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-http2-client-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-http-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-http-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-ee10-webapp-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-ee10-webapp-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-ee10-servlets-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-ee10-servlets-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-ee10-servlet-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-ee10-servlet-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-ee-webapp-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-ee-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-deploy-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-deploy-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-compression-gzip-12.1.10.jar.sha1 | Add SHA1 for new Jetty compression module jar. |
| solr/licenses/jetty-compression-common-12.1.10.jar.sha1 | Add SHA1 for new Jetty compression module jar. |
| solr/licenses/jetty-client-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-client-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-alpn-server-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-alpn-server-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-alpn-java-server-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-alpn-java-server-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-alpn-java-client-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-alpn-java-client-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
| solr/licenses/jetty-alpn-client-12.1.10.jar.sha1 | Add SHA1 for updated Jetty jar. |
| solr/licenses/jetty-alpn-client-12.0.34.jar.sha1 | Remove SHA1 for old Jetty jar. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://issues.apache.org/jira/browse/SOLR-18297
Description
Upgrades Eclipse Jetty from
12.0.34to12.1.10. This is a minor-line jump (12.0 → 12.1) that the 12.0 line is being wound down for, and it required real migration work beyond the version bump — both source API changes and a server-configuration migration.What changed
1. Dependency
eclipse-jetty12.0.34→12.1.10ingradle/libs.versions.toml.*.sha1files. Jetty 12.1 adds new transitive modules (jetty-compression-common,jetty-compression-gzip) and renamesjetty-ee→jetty-ee-webapp; the new compression jars are covered by the existingjetty-license prefix.2. Source API adaptations (compile,
-Werror)Three APIs were deprecated-for-removal / removed in 12.1:
BlockingArrayQueue(int, int)(growBy removed) →BlockingArrayQueue.newInstance(256, Integer.MAX_VALUE), preserving the original unbounded-with-initial-capacity semantics (HttpJettySolrClient).org.eclipse.jetty.io.RuntimeIOException→java.io.UncheckedIOException(SolrCore,CatStream).HttpClient.getTransport()→getHttpClientTransport()(HttpJettySolrClientCompatibilityTest).3. Server configuration migration (
solr/server/etc/jetty.xml)Jetty 12.1 removed the directory-scanning deployer (
DeploymentManager/deploy.providers.ContextProvider). Since Solr serves a single, statically-known webapp, the deployer machinery is unnecessary — the webapp is now added directly to theContextHandlerCollection, and the redundantsolr/server/contexts/solr-jetty-context.xmlis removed. Without this change the distribution fails to start on 12.1 (ClassNotFoundException: org.eclipse.jetty.deploy.DeploymentManager). Considered re-implementing scanning with the new APIs, but keeping it simpler. Advanced users who deploy 3rd party webapps in Solr's Jetty still have the option of tailoring jetty.xml to add those or to wire in scanning. An upgrade note has been added to the ref-guide.4. Config cleanups
maxResponseHeaderSizeexplicitly, configurable via the newsolr.jetty.response.header.size.maxsystem property. Jetty 12.1 changed this default from 8KB to 16KB; the property makes the value explicit and tunable. This is the one behavioral change administrators may notice — response headers up to 16KB are now allowed by default.relativeRedirectAllowed=trueset — it is the Jetty 12.1 default.Migration-guide review
Reviewed every file under
solr/server/etc/against the Jetty 12.0→12.1 migration guide. The deployer block was the only outdated configuration; all other XML (SSL/HTTPS/HTTP2, gzip, request-log, threadpool) resolves cleanly on 12.1.GzipHandler/DeflaterPoolare still present, so the gzip module is unaffected.Verification
./gradlew check -x test— passes (compile, forbidden-apis, license validation).solrj-jetty(incl. HTTP/1↔HTTP/2 compatibility),extraction, and a core HTTP/servlet sample.test_compression,test_ssl(incl. mTLS, client truststore + SecurityManager),test_start_solr.gradlew devdistribution: server starts,/solrreturns HTTP 200,WebAppContextreportsAVAILABLE, and gzip content-encoding negotiates correctly.Out of scope (potential follow-ups)
CompressionAPI (would also enable Brotli/Zstandard).gzip.mod/GzipHandlerstill work, so this is optional.